package com.example.jdbc.bean;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UserRowMapper implements RowMapper {

    @Override
    public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        LearnResource user=new LearnResource();
        user.setId(rs.getInt("id"));
        user.setAuthor(rs.getString("author"));
        user.setTitle(rs.getString("title"));
        user.setUrl(rs.getString("url"));
        return user;
    }
}
